<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" href="../style/journal.css" type="text/css" />
<style type="text/css"><!--
.googleadsense {
	margin: 2px;
	padding: 0px;
//--></style><script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-65008-1";
urchinTracker();
</script><title>Catalyst 在 Win32 下的 Session</title>
</head>
<body>
<a href="index.html">Journal</a>(2005) | <a href="../blog/"><b>Blog</b></a>(2006) | <a href="http://www.fayland.org/cgi-bin/random_link.pl">RandomLink</a> | <a href="AboutFayland.html">WhoAmI</a> | <a href="LiveBookmark.html">LiveBookmark</a> | <a href="http://www.fayland.org/">HomePage</a>
<p><&lt;Previous: <a href="050928_tapl.html">Types and Programming Languages</a>&nbsp;&nbsp;>>Next: <a href="Catalyst_NoFavIcon.html">Catalyst && favicon.ico</a></p>
<h1>Catalyst 在 Win32 下的 Session</h1>
<div class='content'>
<p>Category: <a href='Catalyst.html'>Catalyst</a> &nbsp; Keywords: <b>catalyst session win32</b></p>昨天拿到 <a href="http://blog.chunzi.org">chunzi</a> 的 <a href="http://member.perlchina.org">http://member.perlchina.org</a> 代码。装了很多依赖的模块，最后就死在了 <a href="http://search.cpan.org/perldoc?Cache::FastMmap">Cache::FastMmap</a> 上面。<br />这模块打死也装不起来。说来也很凑巧， <a href="http://dev.catalyst.perl.org">Catalyst</a> 的 <a href='http://lists.rawmode.org/mailman/listinfo/catalyst'>maillist</a> 正在讨论这个问题。<br />依照那里的<a href='http://lists.rawmode.org/pipermail/catalyst/2005-June/000504.html'>指示</a>：<p /><ul><br /><li>在 <a href="http://search.cpan.org/perldoc?Catalyst::Plugin::Session::FastMmap">Catalyst::Plugin::Session::FastMmap</a> 里用 <a href="http://search.cpan.org/perldoc?Cache::FileCache">Cache::FileCache</a> 代替了 Cache::FastMmap<br /><li>打开 Catalyst/Plugin/Session/FastMmap.pm, 修改<br /><ol><li> 第六行用 use Cache::FileCache; 来替代 use Cache::FastMmap;<br /><li> 在一百二十几行 setup 函数里：（+ 的添加, - 的删除）<br /><pre>     $self->config->{session}->{rewrite} ||= 0;<br /> <br />     $self->_session(<br />-        Cache::FastMmap->new(<br />-            share_file  => $self->config->{session}->{storage},<br />-            expire_time => $self->config->{session}->{expires}<br />-        )<br />+        Cache::FileCache->new( {<br />+            default_expires_in => $self->config->{session}->{expires}<br />+        } )<br />     );</pre></ol></ul>现在 Person 代码已经正常的运行在我的电脑上。（除了邮件，注册验证只好直接打开 databse 来找 code）<br />昨晚将一些配置资料提出来生成了 YAML ，然后用 YAML::LoadFile 来导入这些配置文件。这样我修改完代码就可以直接在服务器上覆盖了。<br />打算先好好的看代码。尤其是 Model 部分。我没怎么用过 <a href="http://search.cpan.org/perldoc?Class::DBI::Loader::Relationship">Class::DBI::Loader::Relationship</a> , 得向 chunzi 兄好好学习。</div>
<p><&lt;Previous: <a href="050928_tapl.html">Types and Programming Languages</a>&nbsp;&nbsp;>>Next: <a href="Catalyst_NoFavIcon.html">Catalyst && favicon.ico</a></p>
<p><strong>Options:</strong> <a href='http://del.icio.us/post?title=Catalyst%20%E5%9C%A8%20Win32%20%E4%B8%8B%E7%9A%84%20Session&url=http://www.fayland.org/journal/Catalyst_Session_Win32.html'>+Del.icio.us</a></p>
<strong>Related items</strong>
<ul><li><a href='050328.html'>Catalyst & Eplanet</a> < <span class='digit'>2005-03-28 13:19:19</span> ></li><li><a href='050423.html'>Day [05.4.23] stay with me</a> < <span class='digit'>2005-04-23 16:17:02</span> ></li><li><a href='Catalyst_Authenticate.html'>Catalyst Authenticate</a> < <span class='digit'>2005-09-26 12:50:39</span> ></li><li><a href='Catalyst_Flaw.html'>Catalyst 的一个不足（一个已去掉）</a> < <span class='digit'>2005-09-27 13:44:31</span> ></li><li><a href='Catalyst_NoFavIcon.html'>Catalyst && favicon.ico</a> < <span class='digit'>2005-09-30 00:57:57</span> ></li><li><a href='Catalyst_Overview.html'>我对 Catalyst 的理解和介绍</a> < <span class='digit'>2005-10-08 01:39:40</span> ></li><li><a href='Catalyst_XMLRPC.html'>Catalyst && XML-RPC</a> < <span class='digit'>2005-10-11 21:50:30</span> ></li><li><a href='Catalyst_YAML.html'>Catalyst config YAML</a> < <span class='digit'>2005-12-10 12:50:39</span> ></li><li><a href='CatalystAdventCalendar_CN.html'>Catalyst Advent Calendar 中文版</a> < <span class='digit'>2005-12-15 23:28:40</span> ></li></ul>
Created on <span class="digit">2005-09-29 11:08:04</span>, Last modified on <span class="digit">2005-09-29 11:09:02</span><br />
Copyright 2004-2005 All Rights Reserved. Powered by <a href="Eplanet.html">Eplanet</a> && <a href='http://catalyst.perl.org'>Catalyst</a> 5.62.
</body>
</html>